xenpaging: start paging in the middle of gfn range
authorOlaf Hering <olaf@aepfle.de>
Fri, 10 Jun 2011 08:47:23 +0000 (10:47 +0200)
committerOlaf Hering <olaf@aepfle.de>
Fri, 10 Jun 2011 08:47:23 +0000 (10:47 +0200)
Set the starting gfn to somewhere in the middle of the gfn range to
avoid paging during BIOS startup. This can speedup booting of a guest.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
tools/xenpaging/policy_default.c

index 83fe830309bec8528640ad2606a989ace329447b..0d32c948597ac1e07d2e1668b9511492e28904eb 100644 (file)
@@ -69,6 +69,10 @@ int policy_init(xenpaging_t *paging)
     /* Don't page out page 0 */
     set_bit(0, bitmap);
 
+    /* Start in the middle to avoid paging during BIOS startup */
+    current_gfn = max_pages / 2;
+    current_gfn -= paging->num_pages / 2;
+
     rc = 0;
  out:
     return rc;